package VN.EDU.IMIC.DEVELOPER.NGUYENTHUYOANH_Arr05;

public class Models {

    public void SapXepTang(int a[]) {
        for (int i = 0; i < a.length - 1; i++)
            for (int j = i + 1; j < a.length; j++) {
                if (a[i] > a[j]) {
                    HoanVi(a, i, j);
                }
            }
    }

    void HoanVi(int[] arr, int i, int j) {
        int temp = arr[i];
        arr[i] = arr[j];
        arr[j] = temp;
    }
}
